#ifndef PLOT_H
#define PLOT_H
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_spectrogram.h>
#include <QLineF>
#include <QPointF>
#include <qwt_text.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_marker.h>
#include "file_reader.h"

class MyZoomer: public QwtPlotZoomer
{
public:
    MyZoomer(QwtPlotCanvas *canvas):
        QwtPlotZoomer(canvas)
    {
        setTrackerMode(AlwaysOn);
    }

    virtual QwtText trackerText(const QwtDoublePoint &pos) const
    {
        QColor bg(Qt::white);
#if QT_VERSION >= 0x040300
        bg.setAlpha(200);
#endif

        QwtText text = QwtPlotZoomer::trackerText(pos);
        text.setBackgroundBrush( QBrush( bg ));
        return text;
    }
};


class Plot : public QwtPlot
{
    Q_OBJECT

public:
    Plot(QWidget * = NULL);
    QwtPlotSpectrogram* get_spectrogram();


public slots:
    void showContour(bool on);
    void showSpectrogram(bool on);
    void showWells(bool on);
    void showLines();
    void openWells();
    void printPlot();
    void loadWells();
    void message();
    void insertCurve(const double *x,const double *y, int size);
    void plotExperimentalSemivariogram(QList <double> abscissas, QList <double> ordinate,
                                       QList <double> abscissas1, QList <double> ordinate1);
    void plotExperimentalSemivariogramTeste(QList <double> abscissas, QList <double> ordinate
                                            );


protected:

    QwtPlotSpectrogram *spectrogram;
    FileReader* file;
    QwtRasterData *qwtmap;
    MyZoomer* zoomer;
    QwtPlotMarker*  marker;
    QString linesFileName;
    QString wellsFileName;
};



#endif // PLOT_H

